package fr.n7.sma.model.listeners.events;

import fr.n7.sma.model.Agent;


public class AgentEvent<AgentProperty, CellAdditionnalProperty> {

	public enum EventType {AGENT_MOVED, RESOURCE_TAKEN, RESOURCE_PUT};
	
	private EventType eventType;
	private short[] from;
	private short[] to;
	private String resource;
	private Agent<AgentProperty, CellAdditionnalProperty> agent;

	public AgentEvent(EventType event, Agent<AgentProperty, CellAdditionnalProperty> agent, String resource){
		this.resource = resource;
		this.eventType = event;
		this.agent = agent;
	}
	
	public AgentEvent(Agent<AgentProperty, CellAdditionnalProperty> agent, short[] from, short[] to){
		this.eventType = EventType.AGENT_MOVED;
		this.from = from;
		this.to = to;
		this.agent = agent;
	}

	public EventType getEventType() {
		return eventType;
	}

	public short[] getFrom() {
		return from;
	}

	public short[] getTo() {
		return to;
	}
	
	public short[] getPosition() {
		return to;
	}

	public Agent<AgentProperty, CellAdditionnalProperty> getAgent() {
		return agent;
	}

	public String getResource() {
		return resource;
	}
}
